/***********************************************************************************************************************
 *
 * Project:    mGameEngine
 * File:       vector.h
 * Author:     karooolek
 * Created on: 2008-12-30
 *
 ***********************************************************************************************************************/

#ifndef VECTOR_H_
#define VECTOR_H_

#include "types.h"
#include <vector>

namespace mGameEngine
{

/**
 * Vector container.
 * Elements in vector are packed.
 * They can be accessed by using iterators or indexing [].
 * Vector can be casted to TVal array.
 */
template<typename TVal>
class Vector : public std::vector<TVal>
{
public:
    /**
     * Vector iterator.
     */
    typedef typename std::vector<TVal>::iterator Iterator;

    /**
     * Vector const iterator.
     */
    typedef typename std::vector<TVal>::const_iterator ConstIterator;

    /**
     * Create empty vector.
     */
    Vector() : std::vector<TVal>()
    {
    }

    /**
     * Create vector with initial size.
     * @param size initial size
     */
    Vector(uint size) : std::vector<TVal>(size)
    {
    }

    /**
     * Create vector with initial values.
     * @param size initial size
     * @param initVal initial value
     */
    Vector(uint size, const TVal &initVal) : std::vector<TVal>(size, initVal)
    {
    }

    /**
     * Copy constructor.
     * @param v Vector to copy
     */
    Vector(const Vector &v) : std::vector<TVal>(v)
    {
    }
};

}

#endif // VECTOR_H_
